Skip to content

Conversation

@dhasani23
Copy link
Contributor

Problem

/transform could benefit from more test coverage.

Solution

Add tests.


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.

License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dhasani23 dhasani23 requested review from a team as code owners December 8, 2024 01:18
authType = 'awsId'
}
return authType
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This above function was previously in transformApiHandler.ts, just moving it here so it's in a shared utils file

assert.strictEqual(usesHttpsAndExpiresAfter60Seconds, true)
})

it('WHEN zipCode THEN ZIP contains all expected files and no unexpected files', async function () {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this test to the file above with the other zipCode tests

@@ -35,10 +34,6 @@ describe('transformByQ', async function () {
await fs.writeFile(tempFilePath, 'sample content for the test file')
transformByQState.setProjectPath(tempDir)
const zipCodeResult = await zipCode({
dependenciesFolder: {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used for these tests

Copy link
Contributor Author

@dhasani23 dhasani23 Dec 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/runIntegrationTests to trigger them

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are also run automatically after merging.

@dhasani23
Copy link
Contributor Author

dhasani23 commented Dec 9, 2024

test/e2e/amazonq/transformByQ.test.ts:

image

export { default as MessengerUtils } from './chat/controller/messenger/messengerUtils'
export { GumbyController } from './chat/controller/controller'
export { TabsStorage } from '../amazonq/webview/ui/storages/tabsStorage'
export * as startTransformByQ from '../../src/codewhisperer/commands/startTransformByQ'
Copy link
Contributor Author

@dhasani23 dhasani23 Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unable to run the tests in packages/amazonq/test/e2e/amazonq/transformByQ.test.ts by importing these things from the core module directly where they're defined, as I get an import error when doing that. So instead I have to export them here and then (in the test file, line 11) import them from here.

@dhasani23
Copy link
Contributor Author

/runIntegrationTests

@dhasani23
Copy link
Contributor Author

/runIntegrationTests

@dhasani23
Copy link
Contributor Author

/runIntegrationTests

@dhasani23
Copy link
Contributor Author

/runIntegrationTests

@dhasani23 dhasani23 marked this pull request as draft December 9, 2024 20:38
@dhasani23
Copy link
Contributor Author

/runIntegrationTests

@dhasani23
Copy link
Contributor Author

/runIntegrationTests

@dhasani23
Copy link
Contributor Author

/runIntegrationTests

@dhasani23 dhasani23 marked this pull request as ready for review December 9, 2024 21:50
@justinmk3 justinmk3 merged commit b80529e into aws:master Dec 9, 2024
20 of 21 checks passed
karanA-aws pushed a commit to karanA-aws/aws-toolkit-vscode that referenced this pull request Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants